{extend name="default/template/base_index" /}


{block name="area_header"}

{/block}

{block name="area_body"}
{include file="default/Widget/topbar" /}
<div class="admin-main container-fluid">
	{include file="default/Widget/left" /}
	<div class="admin-main-content">
		{include file="default/Widget/breadcrumb" /}
		<!-- 过滤\查询按钮 -->
		<div class="filter-controls">
			<!-- 日期查询 -->
			<form action="{:url('Material/avatar')}" method="post" class="form-inline searchForm">
				<label>头像类别</label>
				<select class="form-control input-short input-sm select_type" name="type">
					{volist name="avatar_type" id="vo"}
					<option  value="{$vo.code}" {eq name="$vo.code" value="$type"}selected{/eq}>{$vo.name}</option>
					{/volist}
				</select>
				<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-search"></i>{:L('BTN_SEARCH')}</button>
			</form>
		</div>
		<!-- 操作按钮 -->
		<div class="btn-controls">
			<a class="btn btn-primary btn-sm" href="{:url('Material/add')}"><i class="fa fa-plus"></i>{:L('BTN_ADD')}</a>
			<a href="{:url('material/delete_all')}" class="btn btn-danger btn-sm ajax-post confirm" target-form="delete-banners">删除选中项</a>
		</div>

		<table class="table table-striped table table-hover delete-banners table-condensed">
			<thead>
			<tr>
				<th>
					<input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />
				</th>
				<th>ID</th>
				<th>
					图片
				</th>
				<th>
					图片名称
				</th>
				<th>
					类别
				</th>

				<th>
					添加时间
				</th>
				<th>
					操作
				</th>
			</tr>
			</thead>
			<tbody>
			{empty name="list"}
			<tr>
				<td colspan="7" class="text-center">{:L('NO_DATA')}</td>
			</tr>
			{else/}
			{volist name="list" id="vo"}
			<tr>
				<td>
					<input type="checkbox" value="{$vo.id}" name="ids[]" class="selectitem" /></td>
				<td>{$vo.id}</td>
				<td><a href="{$vo.imgurl}" target="_blank" title="点击查看原图"><img style="height:50px;" src="{:getImgUrl($vo['id'],120)}" alt="{$vo.imgurl}" /></a>
				</td>
				<td>
					{$vo.ori_name}
				</td>
				<td>
					{$vo.type_name}
				</td>

				<td>
					{$vo.create_time|date='Y-m-d h:i:s',###}
				</td>
				<td>
					<a href="{:url('Material/edit',array('id'=>$vo['id']))}" class="btn btn-sm btn-default"><i class="fa fa-edit"></i>编辑</a>

					<a href="{:url('Material/delete',array('id'=>$vo['id']))}" class="ajax-get confirm btn btn-sm btn-danger"><i class="fa fa-trash"></i>删除</a>
				</td>
			</tr>

			{/volist}
			{/empty}
			</tbody>
		</table>
		<div>{$show}</div>
	</div>

</div>
<!-- END admin-main-content -->
</div>
<!-- END admin-main-->
{/block}

{block name="area_footer"}
<script type="text/javascript">
	$(function(){
		$('.select_type').val({$type});
		$("select[name='type']").change(function(){
			$('.searchForm').submit();
		});
	});
</script>
{/block}